<!-- 内容 -->
	
<!-- 页面头部 start -->
	<div class="header w990 bc mt15">
		<div class="logo w990">
			<h2 class="fl"><a href="index.html"><img src="__INDEX__/images/logo.png" alt="京西商城"></a></h2>
			<div class="flow fr flow2">
				<ul>
					<li>1.<a href="{:url('lst')}">我的购物车</a></li>
					<li class="cur">2.填写核对订单信息</li>
					<li>3.成功提交订单</li>
				</ul>
			</div>
		</div>
	</div>
	<!-- 页面头部 end -->
	
	<div style="clear:both;"></div>
<form action="{:url('addOrder')}" method="POST" name="order_form">
	<!-- 主体部分 start -->
	<div class="fillin w990 bc mt15">
		<div class="fillin_hd">
			<h2>填写并核对订单信息</h2>
		</div>

		<div class="fillin_bd">
			<!-- 收货人信息  start-->
			<div class="address">
				<h3>收货人信息 <a href="javascript:;" id="address_modify">{if condition="$defalutAddr"}[修改]{else/}[选择收货人地址]{/if}</a></h3>
				<div class="address_info">
					{if condition="$defalutAddr"}
						<p>{$defalutAddr['consignee']}  {$defalutAddr['mobile']} {$defalutAddr['tel']}</p>
						<p>{$defalutAddr['province']['city_name']} {$defalutAddr['city']['city_name']} {$defalutAddr['district']['city_name']} {$defalutAddr['address']} 邮编：{$defalutAddr['zipcode']}</p>
					{/if}
				</div>
				<input type="hidden" name="shr_consignee" value="{if condition="$defalutAddr"}{$defalutAddr.consignee} {/if}" />
				<input type="hidden" name="shr_email" value="{if condition="$defalutAddr"}{$defalutAddr.email} {/if}" />
				<input type="hidden" name="shr_mobile" value="{if condition="$defalutAddr"}{$defalutAddr.mobile} {/if}" />
				<input type="hidden" name="shr_tel" value="{if condition="$defalutAddr"}{$defalutAddr.tel} {/if}" />
				<input type="hidden" name="shr_province" value="{if condition="$defalutAddr"}{$defalutAddr.province.city_name} {/if}" />
				<input type="hidden" name="shr_city" value="{if condition="$defalutAddr"}{$defalutAddr.city.city_name} {/if}" />
				<input type="hidden" name="shr_district" value="{if condition="$defalutAddr"}{$defalutAddr.district.city_name} {/if}" />
				<input type="hidden" name="shr_zipcode" value="{if condition="$defalutAddr"}{$defalutAddr.zipcode} {/if}" />
				<input type="hidden" name="shr_address" value="{if condition="$defalutAddr"}{$defalutAddr.address} {/if}" />
				<div class="address_select none">
					<ul>
						{volist name="address" id="v"}
							<li {if condition="$v['default']"}class="cur"{/if}>
								<input type="radio" name="address" value="{$v['aid']}" {if condition="$v['default']"}checked="checked"{/if} />{$v['consignee']} |  {$v['province']['city_name']}  {$v['city']['city_name']}   {$v['district']['city_name']} | {$v['address']} | {$v['mobile']} {$v['tel']} | 邮编：{$v['zipcode']}
							</li>
						{/volist}
						<li><input type="radio" name="address" class="new_address"  />使用新地址</li><br />
						<li><input type="button" value="使用选中地址" class="select-address-btn" /></li>
					</ul>
					<ul class="new_address_form" style="display: none;">
						<li>
							<label for=""><span>*</span>收 货 人：</label>
							<input type="text" name="consignee" class="txt must" />
						</li>
						<li>
							<label for=""><span>*</span>手机号码：</label>
							<input type="text" name="mobile" class="txt must" />
						</li>
						<li>
							<label for="">电　话：</label>
							<input type="text" name="tel" class="txt" />
						</li>
						<li>
							<label for="">Email：</label>
							<input type="text" name="email" class="txt" />
						</li>
						<li>
							<label for="">邮政编码：</label>
							<input type="text" name="zipcode" class="txt"  />
						</li>
						<li>
							<label for=""><span>*</span>所在地区：</label>
							<select name="province" class="user-add" id="">
								<option value="">请选择</option>
								{volist name="citys" id="city"}
                                    <option value="{$city.cid}">{$city.city_name}</option>
                                {/volist}
								
							</select>

							<select name="city" class="user-add" style="display: none;">
							</select>

							<select name="district" style="display: none;">
							</select>
						</li>
						<li>
							<label for=""><span>*</span>详细地址：</label>
							<input type="text" name="address" class="txt address must"  />
						</li>
						<li>
							<input type="button" class="addAdressBtn" name="" value="新增地址" />
						</li>
					</ul>
				</div>
			</div>
			<!-- 收货人信息  end-->

			<!-- 配送方式 start -->
			<div class="delivery">
				<h3>发货方式</h3>
				<div class="delivery_select">
					<table>
						<tr>
							<th class="col1">送货方式</th>
							<th class="col2">运费</th>
							<th class="col3">运费标准</th>
						</tr>
						{volist name="ships" id="ship"}
							<tr>
								<td>
									<input type="radio" name="post_method" value="{$ship.sid}" {if condition="!$key"}checked="checked"{/if} />{$ship.ship_name}
								</td>
								<td>￥{$ship.ship_price}</td>
								<td>每张订单不满499.00元,运费40.00元, 订单4...</td>
							</tr>
						{/volist}
					</table>
				</div>
			</div> 
			<!-- 配送方式 end --> 

			<!-- 支付方式  start-->
			<div class="pay">
				<h3>支付方式</h3>

				<div class="pay_select">
					<table> 
					{volist name="pays" id="pay"}
						<tr>
							<td class="col1"><input type="radio" name="pay_method" value="{$pay.pid}" {if condition="!$key"}checked="checked"{/if} />{$pay.pay_name}</td>
							<td class="col2">送货上门后再收款，支持现金、POS机刷卡、支票支付</td>
						</tr>
					{/volist}
					</table>
				</div>
			</div>
			<!-- 支付方式  end-->

			<!-- 发票信息 start-->
			<!-- <div class="receipt">
				<h3>发票信息 <a href="javascript:;" id="receipt_modify">[修改]</a></h3>
				<div class="receipt_info">
					<p>个人发票</p>
					<p>内容：明细</p>
				</div>

				<div class="receipt_select none">
					<form action="">
						<ul>
							<li>
								<label for="">发票抬头：</label>
								<input type="radio" name="type" checked="checked" class="personal" />个人
								<input type="radio" name="type" class="company"/>单位
								<input type="text" class="txt company_input" disabled="disabled" />
							</li>
							<li>
								<label for="">发票内容：</label>
								<input type="radio" name="content" checked="checked" />明细
								<input type="radio" name="content" />办公用品
								<input type="radio" name="content" />体育休闲
								<input type="radio" name="content" />耗材
							</li>
						</ul>						
					</form>
					<a href="" class="confirm_btn"><span>确认发票信息</span></a>
				</div>
			</div> -->
			<!-- 发票信息 end-->

			<!-- 商品清单 start -->
			<div class="goods">
				<h3>商品清单</h3>
				<table>
					<tr>
						<th class="col1">商品</th>
						<th class="col2">规格</th>
						<th class="col3">价格</th>
						<th class="col4">数量</th>
						<th class="col5">小计</th>
					</tr>	
					{volist name="carts" id="cart"}
						<tr goods_id="{$cart.gid}" goods_attr_id="{$cart.attr_list}">
							<td class="col1">
								<a href="/{:config('good_cache_dir')}/{$cart.static_url}"><img src='{$cart.pic}' /></a>  
								<strong><a href="/{:config('good_cache_dir')}/{$cart.static_url}">{$cart.goods_name}</a></strong></td>
							<td class="col2"> 
								{volist name="cart.attr_value" id="v"}
									<?php 
										if( !$key ){
											$attr_value = $v['attr_name'].':'.$v['attr_value'];
										}else{
											$attr_value .= ','.$v['attr_name'].':'.$v['attr_value'];
										}
									?>
									{$v.attr_name}:{$v.attr_value}<br />
								{/volist}
							</td>
							<td class="col3">
								￥<span>{$cart.price}</span>元
							</td>
							<td class="col4"> 
								{$cart.num}
							</td>
							<td class="col5">
								￥<span>{$cart.price*$cart.num|number_format=###,2,'.',''}</span>元
								<input type="hidden" name="goods[{$cart.attr_list}][gid]" value="{$cart.gid}" />
								<input type="hidden" name="goods[{$cart.attr_list}][price]" value="{$cart.price}" />
								<input type="hidden" name="goods[{$cart.attr_list}][num]" value="{$cart.num}" />
								<input type="hidden" name="goods[{$cart.attr_list}][goods_name]" value="{$cart.goods_name}" />
								<input type="hidden" name="goods[{$cart.attr_list}][attr_value]" value="{$attr_value}" />
							</td>
						</tr>
					{/volist}
				</table>
			</div>
			<!-- 商品清单 end -->
		
		</div>

		<div class="fillin_ft">
			<a onclick="$('form[name=order_form]').submit();" href="javascript:void(0);"><span>提交订单</span></a>
			<p>应付总额：<strong>￥{$totalPrice}元</strong></p>	
			<input type="hidden" name="totalPrice" value="{$totalPrice}" />	
		</div>
	</div>
	<!-- 主体部分 end -->
</form>
<script>
	getAddressUrl = "{:url('address/getAddress','',false)}";
	getChildCityUrl = "{:url('address/getChildCity','',false)}";
	addAdressUrl = "{:url('address/addAdress','',false)}";
</script>